#include "net_light_config.h"

void waiting_network()
{
    u8 buf[BUF_SIZE];
    bzero(buf,get_color_length());
    for (int i = 0; i<get_light_length();i++)
    {
        buf[i*3+0] = 0x00;
        buf[i*3+1] = 0x00;
        buf[i*3+2] = 0Xff;
    }
    
    logic_send_light_msg_ohter(buf,get_color_length());

}

void connectting_network()
{
    u8 buf[BUF_SIZE];
    bzero(buf,get_color_length());
    for (int i =0; i<get_light_length();i++)
    {
        buf[i*3+0] = 0x00;
        buf[i*3+1] = 0xff;
        buf[i*3+2] = 0X00;
    }
    
    logic_send_light_msg_ohter(buf,get_color_length());

}

void success_network()
{
    u8 buf[BUF_SIZE];
    bzero(buf,get_color_length());
    for (int i =0; i<get_light_length();i++)
    {
        buf[i*3+0] = 0xff;
        buf[i*3+1] = 0xff;
        buf[i*3+2] = 0Xff;
    }
    
    logic_send_light_msg_ohter(buf,get_color_length());
}

void fail_network()
{
    u8 buf[BUF_SIZE];
    bzero(buf,get_color_length());
    for (int i =0; i<get_light_length();i++)
    {
        buf[i*3+0] = 0xff;
        buf[i*3+1] = 0x00;
        buf[i*3+2] = 0X00;
    }
    
    logic_send_light_msg_ohter(buf,get_color_length());
}

void init_net_light_handle_func()
{
    net_light_config.waiting = waiting_network;
    net_light_config.connectting = connectting_network;
    net_light_config.success = success_network;
    net_light_config.fail = fail_network;
}



